<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="<?php echo __PUBLIC__?>/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="<?php echo __PUBLIC__?>/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link href="<?php echo __PUBLIC__?>/Admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="<?php echo __PUBLIC__?>/Admin/Flat/img/favicon.ico">
	    <script type="text/javascript" src="<?php echo __PUBLIC__?>/uploadify/jquery-1.8.2.min.js"></script>
        <script type="text/javascript" src="<?php echo __PUBLIC__?>/uploadify/jquery.uploadify.min.js"></script>
         <link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/uploadify/uploadify.css">
	   
	</head>
	<body>
	<form action="" method="post" enctype="multipart/form-data">
		<div class="alert alert-success">添加商品品牌</div>
		<div class="form-group">
			<label for="exampleInputEmail1">品牌名称</label>
			<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入品牌名称"  name="bname">
		</div>
				<!-- LOGO图片上传 -->
		<div class="form-group">
			<label for="exampleInputEmail1">品牌LOGO</label>
			<!-- <input id="exampleInputEmail1" type="file"  name="logo"> -->
			<!-- ====文件上传===== -->
<div lab="uploadFile">
    <input id="file" name="logo" type="file" >
    <a href="javascript:$('#file').uploadify('upload')" style="display: inline-block;" class="btn btn-info btn-sm ">上传</a>

    <span>类型: *.jpg,*.png 大小: 2000KB 数量: 10</span>
    <script type="text/javascript">
        $(function() {
            $('#file').uploadify({
                'formData'     : {//POST数据
                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
                },
               	//上传允许类型
                'fileTypeExts' : '*.jpg;*.png',
                //上传的flash
                'swf'      : '<?php echo __PUBLIC__?>/uploadify/uploadify.swf',
                //php的上传方法
                'uploader' : '<?php echo U('uploadLogo')?>',//提交到控制器的uploadLogo方法里面
                'buttonText':'选择文件',
                //上传大小
                'fileSizeLimit' : '2000KB',
                //上传文件数
                'uploadLimit' :10,
                'width':65,
                'height':25,
                'auto':false,
                //等待服务器响应时间
                'successTimeout':10,
                //成功显示时间
                'removeTimeout' : 0.2,
                //当上传成功之后
                'onUploadSuccess' : function(file, data, response) {
                    //转为json
                    data=$.parseJSON(data);
                    //获得图片地址
                    var imageUrl = data.url;
                    var li="<li><img src='"+imageUrl+"'/><input type='hidden' name='logo' value='"+data.path+"'/></li>";
                    $("#uploadList ul").prepend(li);
                }
            });
        });
    </script>
    <!--异步上传完成之后显示图片的位置-->
    <div id="uploadList">
        <ul>
			
        </ul>
    </div>
</div>
<!-- ========= -->
		</div>
		
		<div class="form-group">
			<label for="exampleInputEmail1">排序</label>
			<input id="exampleInputEmail1" class="form-control"  type="text" value="1" name="sort">
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">是否热门：</label>
			<input type="radio" name="ishot" id="" value="0">否
			<input type="radio" name="ishot" id="" checked="" value="1">是
		</div>
		<button class="btn btn-primary btn-block"  type="submit"> 确定 </button>
		</form>
	</body>
</html>
